package com.qf.dao.impl;

import com.qf.dao.ProfileDao;
import com.qf.pojo.Profile;
import com.qf.utils.DBUtil;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;

/**
 * @author 29125
 * @version V1.0
 * @Project java2203
 * @Package com.qf.dao.impl
 * @Description:
 * @Date 2022/5/27 16:25
 */
public class ProfileDaoImpl implements ProfileDao {
    private QueryRunner queryRunner=new QueryRunner(DBUtil.getDataSource());
    @Override
    public void modify(Profile profile) {
        String sql=" update profile set id=?,name=?,birthday=?,gender=?,career=?,address=?,mobile=?,picture=?  ";
        try {
            queryRunner.update(sql,new BeanListHandler<Profile>(Profile.class),profile);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
